﻿
using System;
using System.Configuration;
using System.Collections.Generic;
using IGolovkine.ShoutCastRipper;

namespace IGolovkine.ShoutCastRipper.Service.Configuration
{
    public class StationRipperServiceSection : ConfigurationSection
    {
        private const string StationRippersTag = "stationRippers";
        private const string StationRippersServiceTag = "stationRipperService";
        private const string LoggerParameterTag = "loggerParameter";
        
        public StationRipperServiceSection()
        {
        }

        [ConfigurationProperty(LoggerParameterTag, IsRequired = true)]
        public string LoggerParameter
        {
            get { return (string)this[LoggerParameterTag]; }
        }

        [ConfigurationProperty(StationRippersTag, IsRequired = false)]
        public StationRipperElementCollection StationRippers
        {
            get { return this[StationRippersTag] as StationRipperElementCollection; }
        }

        public static StationRipperServiceSection Load()
        {
            return (StationRipperServiceSection) ConfigurationManager.GetSection(StationRippersServiceTag);
        }

        public override bool IsReadOnly()
        {
            return false;
        }
    }
}
